home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / info-service / gopher / Unix / GopherTools / jughead / jughead.0.9 / Makefile < prev    next >
Encoding:
Makefile  |  1993-05-24  |  10.5 KB  |  298 lines

  1. #############################################################################
  2. # File:        Makefile
  3. #
  4. # Author:    Rhett "Jonzy" Jones
  5. #        jonzy@cc.utah.edu
  6. #
  7. # Date:        February 17, 1993
  8. #
  9. # Modified:    March 27, 1993, by Rhett "Jonzy" Jones.
  10. #        Consolidated various #defines from the source files into
  11. #        this Makefile to ease the portability of jughead.
  12. #
  13. #        March 28, 1993, by Rhett "Jonzy" Jones.
  14. #        Now use THEVERSION as part of the compressed tar files
  15. #        name.  Example: if THEVERSION = 0.3_beta the resultant
  16. #        tar file will have the name jughead.0.3_beta.tar.Z
  17. #
  18. #        March 30, 1993, by Rhett "Jonzy" Jones.
  19. #        Added the ability for the user to specify the inclusion
  20. #        of <varargs.h> if VARARGS is uncommented, otherwise <stdarg.h>
  21. #        will be used.  Some compilers have vsprintf() return an int,
  22. #        and others a char*, so depending on which VSPRINTTYPE is
  23. #        is uncommented will determine which type is returned by this
  24. #        routine.  Also allowed the ability to use prototypes by
  25. #        uncommenting PROTOTYPES, the use of NOWARNINGS and the
  26. #        OPTIMIZATION flags.
  27. #
  28. #        April 29, 1993, by Rhett "Jonzy" Jones.
  29. #        Added POSIXSOURCE for use when compiling under A/UX, and
  30. #        commented what variables should be used for various operating
  31. #        systems to assist in the porting of jughead.
  32. #
  33. #        May 11, 1993, by Rhett "Jonzy" Jones.
  34. #        make install now installs jughead and the manpage with 755
  35. #        permissions.  make semiclean now removes anything ending in a
  36. #        percent character, '%'.  This was done to support textedit on
  37. #        a sun.
  38. #
  39. #        May 14, 1993, by Rhett "Jonzy" Jones.
  40. #        Changed some of the comments to assist those porting to
  41. #        ultrix4.2.
  42. #
  43. #        May 15, 1993, by Rhett "Jonzy" Jones.
  44. #        Moved "$(NOWARNINGS)" from the macro CFLAGS to the target
  45. #        jughead, and added "%.o:= CFLAGS += $(NOWARNINGS)" to support
  46. #        the use of the lint target, which does not like -w.  This was
  47. #        done so both the targets jughead and lint can utilize the CFLAGS
  48. #        macro.  Added support for lint.  And attempted to give better
  49. #        directions when porting the code.
  50. #
  51. #        May 20, 1993, by Rhett "Jonzy" Jones.
  52. #        Included the source files getargs.c, and jughead.h.
  53. #
  54. #        May 22, 1993, by Rhett "Jonzy" Jones.
  55. #        Added DEFAULTBOOLOP to the Makefile to allow one to alter
  56. #        the default boolean operation if none is given seperating
  57. #        words to search on.  Thank danj@welchgate.welch.jhu.edu
  58. #        for this one.
  59. #
  60. #        May 22, 1993, by Rhett "Jonzy" Jones.
  61. #        Changed DEFAULTBOOLOP to DEFBOOLOP.  So the compiler
  62. #        wouldn't get a null string.  Oops.  Thank you
  63. #        doyle@liberty.uc.wlu.edu for informing of this problem.
  64. #
  65. #        May 23, 1993, by Rhett "Jonzy" Jones.
  66. #        Added JUGHEADHELPDOC to supports some special commands
  67. #        when jughead is a search engine.  Also added searchCmnds.c
  68. #        as a dependency.  Added THEHOST, which should be the
  69. #        fully qualified name of the machine running jughead.
  70. #
  71. #        May 24, 1993, by Rhett "Jonzy" Jones.
  72. #        Utermann@Uni-Augsburg.DE reported a problem with make
  73. #        on a RS6000, so I tweeked the Makefile a bit, and added
  74. #        the macro DFLAGS, which is the -D macros for use with
  75. #        lint.
  76. #
  77. # Description:    Contains various make directives and source defines.  The
  78. #        particular make directives supported here are:
  79. #            make all
  80. #            make install
  81. #            make realclean
  82. #            make clean
  83. #            make semiclean
  84. #            make tar
  85. #            make viewman
  86. #            make lint
  87. #
  88. # Copyright:    Copyright 1993, University of Utah Computer Center.
  89. #        This source may be freely distributed as long as this copyright
  90. #         notice remains intact, and is in no way used for any monetary
  91. #         gain, by any institution, business, person, or persons.
  92. #############################################################################
  93.  
  94. # jughead has been successfuly ported to A/UX, AIX, SunOS 4.1.2,
  95. # ultrix, and ultrix4.2.
  96.  
  97. #----------------------------------------------------------------------------
  98. # These are the defines you will need to edit if need be.  If you get any
  99. # make errors or segmentation faults, I suggest you first make sure you
  100. # verify the VARARGS macro, and the proper VSPRINTTYPE macro.  For more
  101. # information on these macros see the comments immediatly above the macro.
  102.  
  103. # The version of this program.
  104. THEVERSION    = 0.9
  105.  
  106. # This is the name of the machine jughead is running on.
  107. THEHOST    = soar.cc.utah.edu
  108.  
  109. # This is the gopher information stating where the "About.jughead" document
  110. # is located.  What this string consists of is a tab followed by the
  111. # selector string or Path, with another tab, the host, tab, and finaly the port.
  112. # If you don't want any of this information displayed use the definition that
  113. # is commented out.
  114. #JUGHEADHELPDOC    = "\t\terror.host\t-1"
  115. JUGHEADHELPDOC    = "\t0/About the U of U Gopher/About jughead\tsns.utah.edu\t70\r\n"
  116.  
  117. # If you wish to alter the characters that delimit a word when doing a
  118. # search, refer to the following line in "search.c".
  119. # #define DELIMITERS    " \t\n\f\r !\"#$%&\'()+,-./:;<=>?@[\\]^_`{|}~"
  120.  
  121. # This is the default boolean operation to perform when searching, when
  122. # there exists no boolean operator between words.  It can be one of
  123. # "AND", "OR", "NOT", but I have no idea why you would select "NOT".
  124. DEFBOOLOP    = "AND"
  125.  
  126. # The cat system command to use.
  127. THECATCOMMAND    = "cat %s >> %s"
  128.  
  129. # The delete, remove, or unlink system command to use.
  130. THERMCOMMAND    = "rm -f %s"
  131.  
  132. # This is the system dependent call to "sort".  It needs to be a call to sort
  133. # such that we only sort on text after the first tab character.  In this sort
  134. # command the first "%s" is the name of the resultant sorted file, and the
  135. # second "%s" is the name of the file to have sorted.  The "-T /tmp" says
  136. # to use /tmp as the place for any temporary files.  The use of sort is not to
  137. # sort the data but to remove any duplicates that may have been written to the
  138. # file.
  139. THESORTCOMMAND    = "sort -d -f -u -o %s -t'    ' -T /tmp +1.0 %s"
  140.  
  141. # The temporary files name.
  142. THETMPFILENAME    = /tmp/jughead.tmp
  143.  
  144. # The port to fire the search engine under.
  145. THEPORT2USE    = 3000
  146.  
  147. # The manual suffix.
  148. MANSUFF = 1
  149.  
  150. # This is where the executable goes.
  151. # Note: in versions prior to 0.9 this was /usr/local/bin
  152. DESTDIR     = /usr/local/etc
  153.  
  154. # This is where the man page goes.
  155. DESTMAN     = /usr/local/man/man$(MANSUFF)
  156.  
  157. # What permissions do you want for jughead?
  158. PERMISSIONS    = 750
  159.  
  160. # Uncomment the following if you do not have <stdarg.h>.
  161. # You want this uncommented if you don't have an ANSI C compiler
  162. # such as the compiler for the sun, or ultrix4.2. You can check
  163. # this by doing "ls /usr/include/stdarg.h", if it is not found
  164. # you will need to uncomment this macro.  Furthermore, you can
  165. # determine if this is needed by doing a "man vsprintf" and
  166. # determining which include is needed.
  167. VARARGS    = -DUSE_VARARGS_H
  168.  
  169. # Uncomment the type which vsprintf() returns.  You can determine
  170. # this by doing a "man vsprintf", if it says "int vsprintf(...)" 
  171. # vsprintf returns an int, if is says "char *vsprintf(...)" it
  172. # returns a str.
  173. #VSPRINTTYPE    = -DVSPRINTF_RETURNS_INT    # AIX:RS6000, ultrix4.2:DEC.
  174. VSPRINTTYPE    = -DVSPRINTF_RETURNS_STR    # SunOs:sun, ultrix:DEC.
  175.  
  176. # Comment the following if your complier does not support prototypes.
  177. # You want this commented out if you don't have an ANSI C compiler
  178. # such as the standard compiler for the sun, and a DEC.
  179. #PROTOTYPES    = -DUSEPROTOTYPES
  180.  
  181. # The following should be uncommented if compiling under A/UX.
  182. # Thank you hagberg@cumc.cornell.edu for this one.
  183. #POSIXSOURCE    = -D_POSIX_SOURCE
  184.  
  185. # Uncomment the following if you don't want warning messages printed.
  186. # This should be commented out if on a DEC.  But can be used with
  187. # ultrix4.2.
  188. NOWARNINGS    = -w
  189.  
  190. # Set any optimization or debugging flags you want here.
  191. OPTIMIZATION    =
  192.  
  193. # The C compiler to use.
  194. CC    = /bin/cc
  195.  
  196. # The location of lint.
  197. LINT    = /bin/lint
  198.  
  199. # Any lint flags you want to use go here.
  200. LINTFLAGS =
  201.  
  202. # End of the defines you need to edit.
  203. #----------------------------------------------------------------------------
  204.  
  205. # The #define flags to set.
  206. DFLAGS    = -DVERSION=\"$(THEVERSION)\"        \
  207.       -DHOSTNAME=\"$(THEHOST)\"        \
  208.       -DJUGHEADHELP=\"$(JUGHEADHELPDOC)\"    \
  209.       -DDEFAULTBOOLOP=\"$(DEFBOOLOP)\"    \
  210.       -DCATCOMMAND=\"$(THECATCOMMAND)\"    \
  211.       -DRMCOMMAND=\"$(THERMCOMMAND)\"    \
  212.       -DSORTCOMMAND=\"$(THESORTCOMMAND)\"    \
  213.       -DTMPFILENAME=\"$(THETMPFILENAME)\"    \
  214.       -DPORT2USE=$(THEPORT2USE)        \
  215.       $(VARARGS)                \
  216.       $(VSPRINTTYPE)            \
  217.       $(PROTOTYPES)                \
  218.       $(POSIXSOURCE)
  219.  
  220. CFLAGS    = $(DFLAGS)                \
  221.       $(OPTIMIZATION)            \
  222.       $(NOWARNINGS)
  223.  
  224.  
  225. # The sources for use with lint.
  226. SRC    = dirTree.c getargs.c jughead.c searchCmnds.c search.c sockets.c tree.c utils.c
  227.  
  228. # The objects requred to create jughead.
  229. OBJS    = dirTree.o getargs.o jughead.o searchCmnds.o search.o sockets.o tree.o utils.o
  230.  
  231. # List of files to have tar'ed and compressed.
  232. TARFILES= dirTree.c getargs.c jughead.c searchCmnds.c search.c sockets.c    \
  233.       tree.c utils.c dirTree.h tree.h utils.h jughead.h            \
  234.       Makefile jughead.1 jughead.survey About.jughead
  235.  
  236. # The name of the tar'ed and compressed file.
  237. TARNAME    = jughead.$(THEVERSION).tar.Z
  238.  
  239. all: jughead
  240.  
  241. # This is the default target, which will make jughead.
  242. jughead:$(OBJS)
  243.     $(CC) $(CFLAGS) -o jughead $(OBJS)
  244. #    echo "Are you sure $(THEVERSION) is the correct version of jughead?"
  245.  
  246. # The various objects and their dependencies.
  247. dirTree.o:    dirTree.c dirTree.h utils.h
  248. jughead.o:    jughead.c jughead.h dirTree.h tree.h
  249. searchCmnds.o:    searchCmnds.c
  250. search.o:    search.c tree.h utils.h
  251. sockets.o:    sockets.c utils.h
  252. tree.o:        tree.c tree.h
  253. utils.o:    utils.c
  254. getargs.o:    getargs.c jughead.h
  255. jughead.h:    utils.h
  256.  
  257. # Make jughead if need be and install jughead and the man page.
  258. # Note: you need to be root for this one.
  259. install:jughead
  260.     cp jughead $(DESTDIR)/jughead
  261.     chown root $(DESTDIR)/jughead
  262.     chmod $(PERMISSIONS) $(DESTDIR)/jughead
  263.     cp jughead.1 $(DESTMAN)/jughead.$(MANSUFF)
  264.     chown root $(DESTMAN)/jughead.$(MANSUFF)
  265.     chmod 755 $(DESTMAN)/jughead.$(MANSUFF)
  266.  
  267. # Clean everything up including the installed jughead and man page.
  268. # Note: you need to be root for this one too.
  269. realclean:clean
  270.     rm -f $(DESTDIR)/jughead
  271.     rm -f $(DESTMAN)/jughead.$(MANSUFF)
  272.  
  273. # Clean everything up except for the installed jughead and man page.
  274. clean:semiclean
  275.     rm -f jughead
  276.  
  277. # Just remove the objects and any backup files created from an editor.
  278. semiclean:
  279.     rm -f *.o
  280.     rm -f *~        # emacs backup files.
  281.     rm -f *%        # Sun textedit backup files.
  282.     rm -f lint.doc        # The lint document if its around.
  283.  
  284. # Tar the sources up into a tar'ed and compressed file.
  285. # Note: This does not do anything with the jughead.ReadMe file.
  286. tar:
  287.     /bin/tar -cvf - $(TARFILES) | compress -c > $(TARNAME)
  288.  
  289. # Display the man page even though it hasn't been installed.
  290. viewman:
  291.     nroff -man jughead.1 | more
  292.  
  293. # Have lint report on the programmers ability to write C code.
  294. lint:$(SRC)
  295.     $(LINT) $(LINTFLAGS) $(DFLAGS) $(SRC) > lint.doc
  296.     more lint.doc
  297.  
  298.